using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Wumpus
{
    [DataContract]
    public class Inventory
    {
        public Inventory(int coins, int arrows) { Coins = coins; Arrows = arrows; }
        public Inventory() : this(0, 0) { } //required for serialization

        [DataMember]
        public int Coins;
        [DataMember]
        public int Arrows;

        public void AddInventory(ref Inventory inventory)
        {
            this.Coins += inventory.Coins;
            this.Arrows += inventory.Arrows;

            inventory.Coins = 0;
            inventory.Arrows = 0;
        }

        public bool IsEmpty() { return Coins == 0 && Arrows == 0; }
    }


    [DataContract(IsReference = true)] 
    public class Hazard
    {
        [DataMember] public Planet CurrentPlanet;

        public Hazard() { }
        public Hazard(Planet planet)
        {
            this.CurrentPlanet = planet;
        }

        public void Panic() //travel around randomly
        {
            //TODO: logic for this
        }
    }

    //TODO: define specific hazards and behaviors

    [DataContract]
    public class Player 
    {
        [DataMember] public Inventory Inventory;
        [DataMember] public int score;
        [DataMember] public int turnsTaken;

        public Player() { }
        public Player(Inventory inventory) 
        {
            this.Inventory = inventory;
            this.score = 0;
            this.turnsTaken = 0;
        }
    }

}
